#include <QtGui/QGuiApplication>
#include <QtQuick/QQuickView>
#include <QtQml/QQmlEngine>
#include <QtQml/QQmlContext>
#include <QtQuick/QQuickItem>
#include <QLoggingCategory>

#include "appmodel.h"

int main(int argc, char *argv[])
{
  QLoggingCategory::setFilterRules("wapp.*.debug=false");
  QGuiApplication application(argc, argv);

  qmlRegisterType<WeatherData>("whandgo", 1, 0, "WeatherData");
  qmlRegisterType<AppModel>("whandgo", 1, 0, "AppModel");

  qRegisterMetaType<WeatherData>("WeatherData");

  const QString mainQmlApp = QStringLiteral("qrc:///whandgo.qml");
  QQuickView view;
  view.setSource(QUrl(mainQmlApp));
  view.setResizeMode(QQuickView::SizeRootObjectToView);

  QObject::connect(view.engine(), SIGNAL(quit()), qApp, SLOT(quit()));
  view.setGeometry(QRect(100, 100, 360, 640));
  view.show();

  return application.exec();
}
